<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
<!--将模板引擎的库文件引入当前页面-->
    <script src="/js/template-web.js"></script>
</head>
<body>

<div class="container"></div>
<!--准备art-template模板-->
    <script id="tpl" type="text/html">
        <h1>{{username}} {{age}}</h1>
    </script>
<script type="text/javascript">
//告诉模板引擎将哪个数据和哪个模板进行拼接-
    const html = template('tpl',{username: 'zhangsan',age: 20});
    document.querySelector('.container').innerHTML = html;
</script>
</body>
</html>